<me:UIGAAUF x:Class="WPFExcelReport.TGD610"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
     xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
     xmlns:me="clr-namespace:WPFExcelReport" 
     xmlns:PR="clr-namespace:WPFExcelReport;assembly=TICC_PRULES"  
     xmlns:MU="clr-namespace:WPFExcelReport;assembly=TABAUFM" 
     xmlns:GB="clr-namespace:WPFExcelReport;assembly=TGLLG" 
    xmlns:GS="clr-namespace:WPFExcelReport;assembly=TGSDAT" 
    xmlns:ABK="clr-namespace:WPFExcelReport;assembly=TABKOPF"  
    xmlns:QR="clr-namespace:WPFExcelReport;assembly=TICC_AV95RULES" 
    xmlns:GC="clr-namespace:WPFExcelReport;assembly=TGSCOLOR" 
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIGAAUF.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
    </me:UIGAAUF.Resources>
    <StackPanel>
        <WrapPanel>
            <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Button Grid.Column="0" Click="OrderCommand" Height="20" Margin="5,0,0,0" Width="20"
                        IsEnabled="{Binding IsNewEnabled,ElementName=TV}" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                    </Button.Background>
                </Button>
                <Button Grid.Column="1" Click="RemoveCommand" Height="20" Margin="5,0,0,0" Width="20">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                    </Button.Background>
                </Button>
                <TextBox Grid.Column="3" Name="txtDel" Text="N"></TextBox>
                <Button Grid.Column="4" Content="{Binding Source={Localization:Translate Word=有变更}}" Foreground="Red" FontSize="18"  Click="CommmandChg" 
                        Visibility="{Binding IsChg,ElementName=TV,Converter={StaticResource bv}}"
                        />

            </Grid>
            <Button Grid.Column="0" Click="btnSplitBatch_Click" Height="20" Margin="15,0,0,0" Width="Auto"  Content="{Binding Source={Localization:Translate Word=分批}}"/>
            <Button Grid.Column="0" Click="btnCompensation_Click" Height="20" Margin="15,0,0,0" Width="Auto"  Content="{Binding Source={Localization:Translate Word=补产}}"/>
            <WrapPanel Visibility="{Binding IsFP,ElementName=TV,Converter={StaticResource bv}}">
                <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=数量:}}" Foreground="Red" ></TextBlock>
                <ex:NumericBox  Grid.Column="2" 
                                DecimalPlaces="1"
                                Text="{Binding SQTY, Converter={StaticResource d100},ElementName=TV}" MinWidth="60" FontSize="18"/>

            </WrapPanel>
        </WrapPanel> 
        <WrapPanel>
        <Grid Margin="10,0,0,0" Grid.Column="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=需求:}}" ></TextBlock>
                <TextBlock  Grid.Column="1" Text="{Binding GAKG1, Converter={StaticResource d100}}" MinWidth="60" FontSize="18"/>
                <TextBlock Grid.Column="2" Text="{Binding Source={Localization:Translate Word=留位:}}" ></TextBlock>
                <TextBlock  Grid.Column="3" Text="{Binding GAKG3,Source={StaticResource vwMaster}, Converter={StaticResource d100}}" MinWidth="60" FontSize="18"/>
            </Grid>
            <Grid Margin="10,0,0,0" Grid.Column="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=预留:}}" ></TextBlock>
                <TextBlock  Grid.Column="3" Text="{Binding GAKG2,Source={StaticResource vwMaster}, Converter={StaticResource d100}}" MinWidth="60" FontSize="18"/>
            </Grid>
            <Grid Margin="10,0,0,0" Grid.Column="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=差异:}}" ></TextBlock>
                <TextBlock  Grid.Column="1" Foreground="Red" Text="{Binding TOLOCK,ElementName=TV, Converter={StaticResource d100}}" MinWidth="60" FontSize="18"/>
            </Grid>
        </WrapPanel>
        <PR:TVKRULES Grid.Row="0" Grid.Column="0" 
                     Name="cVKR"              
                      dwRule="{Binding dwRule,ElementName=TV}" 
                     ARTSTAGE="{Binding ARTSTAGE,ElementName=TV}" 
                      ORDERNUM="{Binding KEY,ElementName=TV}"/>
        <MU:TABMU   Grid.Row="0" Grid.Column="0" 
                  Name="cMU" 
                   EXAUF="{Binding AUF,ElementName=TV}"
                    EXTPROD="{Binding EXTPROD,ElementName=TV}" 
                   dwMU="{Binding dwMU,ElementName=TV}"
                    /> 
        <ABK:TABKOPF Name="cABK"  Grid.Row="0" Grid.Column="0" 
                     ORDERNUM="{Binding ABAUF,ElementName=TV}" 
                     dwABK="{Binding dwABK,ElementName=TV}" 
                     />  
    </StackPanel>
</me:UIGAAUF>
